(function (lib, config) {
    var loadFunc = function () {
        var textAry = config.words.split('|'), bgcolorAry = config.bgcolor.split('|'), textcolorAry = config.textcolor.split('|'), imglinkAry = config.imglink.split('|'), weblinkAry = config.weblink.split('|'), identifier = config.identifier.split('|');
        textAry[0] = textAry[0] || '咨询电话：';
        textAry[1] = textAry[1] || '0451-84832055';
        textAry[2] = textAry[2] || '九龙劳动节巨献~：1.性功能专项检查<font color=\"red\">98元</font>；2.综合治疗费<font color=\"red\">7折</font>；3.脱细胞生物材料延时增粗术减免<font color=\"red\">500元</font>。';
        imglinkAry[0] = imglinkAry[0] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/ask_new_sxm.png';
        bgcolorAry[0] = bgcolorAry[0] || '#a95300';
        identifier[0] = identifier[0] || 'dibu_tanchu_sanyue';
        textcolorAry[0] = textcolorAry[0] || '#fff';
        textcolorAry[1] = textcolorAry[1] || '#fff';
        textcolorAry[2] = textcolorAry[2] || '#000';
        bgcolorAry[1] = bgcolorAry[1] || '#f9f5f0';
        /*TODO 方法*/
        var strVar = [];
        strVar.push("<style type=\"text\/css\">");
        strVar.push(".cf:before,.cf:after{display: table;content:\"\"}.cf:after{clear:both}.cf{zoom:1}");
        strVar.push(".shadow {z-index:99999990; display: none; position: fixed; width: 100%; height: 100%; top:0; left:0; background-color: rgba(0,0,0,.2); }");
        strVar.push(".float_container {z-index:999991; display: none; position: fixed; width: 100%;"+lib.util.getPosStyle(config)+" ; background-color:" + bgcolorAry[1] + "; font-size: 14px;}");/*left:0; bottom:0*/
        strVar.push(".db { display: block}");
        strVar.push(".float_container .title_swt {background:" + bgcolorAry[0] + ";font-size:16px; line-height:40px; height:40px; color:#fff; text-align: center; font-family:\"Microsoft Yahei\"; }");
        strVar.push(".float_container .title_swt a {display: block; color:#FFFFFF; text-align:center;float:left;}");
        strVar.push(".float_container .title_swt a:before {content:\"\";background:url(http://m.hebjlnk.com/swt/20180309qdswt/img/ask_new_tel.png) no-repeat;background-size:100%;width:20px; height:20px;float:left;margin:10px;}");
        strVar.push(".float_container .title_swt span {display:block;float:right;margin-right:10px;}");
        strVar.push(".float_container dl { display: none; transiton:all .3s linear 0s;margin:0;padding:0;}");
        strVar.push(".float_container dt { display: inline-block; width: 14%; float: left; margin: 34px 0 0 8px; text-align: center}");
        strVar.push(".float_container dt img{max-width:100%;border:0;vertical-align:middle;-ms-interpolation-mode: bicubic}");
        strVar.push(".float_container dd {margin:0; display: inline-block; position: relative; width: 80%; float: left; margin-top: 5px; }");
        strVar.push(".float_container .time1 { font-size: 12px; line-height: 1.6; color:#6c6761; text-align: center;width:100%;margin:0;height:1.6em; }");
        strVar.push(".float_container .box_ss i { color:#cc0a0a; font-style:normal;}");
        strVar.push(".float_container .box_ss em{font-style:normal;}");
        strVar.push(".float_container .box_ss { color:" + textcolorAry[2] + ";position: relative; margin-left: 5%; padding:10px; border:1px solid #b8e2ff; border-radius: 12px; box-shadow: 0 3px 0 #3aa1e5, inset 0 1px 1px #fff; background-color:#b8e2ff;overflow:visible; }");
        strVar.push(".float_container .box_ss span{ color:#de0000;}");
        strVar.push(".float_container .box_ss img { width: 22px; vertical-align: bottom; display:inline-block;}");
        strVar.push(".float_container .box_ss:before,");
        strVar.push(".float_container .box_ss:after { position: absolute; content: \"\"}");
        strVar.push(".float_container .box_ss:before { width: 18px; height: 13px; top:-1px; left:-9px; background:url(http://m.hebjlnk.com/swt/20180309qdswt/img/arrow.png) 0 0 no-repeat; background-size: 18px; }");
        strVar.push(".float_container .box_ss:after { width: 40px; height: 26px; bottom:-4px; right:-7px; background:url(http://m.hebjlnk.com/swt/20180309qdswt/img/wave.png) 0 0 no-repeat; background-size: 40px; }");
        strVar.push(".float_container .btn { margin-top: 15px; padding:10px 0; background-color: " + bgcolorAry[0] + "; clear: both;");
        strVar.push("display: table;");
        strVar.push("width: 100%;}");
        strVar.push(".float_container .btn a { display: inline-block; width: 39%; height: 28px; float:left; margin:0 5%; border-radius: 14px; background-color: #f8f8fa; font-size: 16px; color:#333; line-height: 28px; text-align: center; text-decoration: none; transition:all .3s linear 0s; box-shadow:0 2px 3px #060001;}");
        strVar.push(".float_container .btn a:nth-child(2) {background-color: #ffba00;}");
        strVar.push("<\/style>")
        strVar.push('<div class="swtdw" id="swtdingwei">' + '<div class="swtb" onclick="onclick=\"openZoosUrl(\'' + identifier[0] + '\');LR_HideInvite();return false;">' + '</div></div>');
        strVar.push('<div id="toopl" class="shadow"></div>' +
        '<div id="footTool" class="float_container cf" style="z-index:300000000;">' +
        '<div class="title_swt"><a href="tel:' + textAry[1] + '"><span style="color:'+textcolorAry[0]+';">' + textAry[0] + '</span><span style="color:'+textcolorAry[1]+';">'+ textAry[1] + '</span></a><span onclick="toolclose();">关闭</a></div>' +
        '<dl id="tools2" class="cf" >' +
        '<dt><img src="' + imglinkAry[0] + '"></dt>' +
        '<dd>' +
        '<div id="now1" class="time1"></div>' +
        '<a onclick=\"openZoosUrl(\'' + identifier[0] + '\');\" style="text-decoration: none;"><div class="box_ss">' + textAry[2] + '</div></a>' +
        '</dd>' +
        '</dl>' +
        '<div class="btn cf">' +
        '<a href="tel:' + textAry[1] + '\">电话咨询</a>' +
        '<a class=\"a-jg\" onclick=\"openZoosUrl(\'' + identifier[0] + '\');LR_HideInvite();return false;\">立即回复</a>' +
        '</div>' +
        '</div>');
        var o = document.createElement('div');
        o.innerHTML = strVar.join('');
        while (o.firstElementChild) {
            document.body.appendChild(o.firstElementChild);
        };
        /*获取当前时间*/
        var now = new Date();
        var hh = now.getHours();
        var mm = now.getMinutes();
        var ss = now.getSeconds();
        var date1 = document.getElementById("now1");
        function getDateWeek(obj) { if (obj < 10) return "0" + obj; else return obj; }
        date1.innerHTML = getDateWeek(hh) + ":" + getDateWeek(mm) + ":" + getDateWeek(ss);

        var footTool = document.getElementById("footTool");
        var toopl = document.getElementById("toopl");
        var tools2 = document.getElementById("tools2");
        setTimeout(toolshow, config.firsttime * 1000);
        function toolshow() {
            //newSwtCenterClose();
            //close_swt();
            document.getElementById('swtdingwei').style.display = 'none';
            footTool.className = "float_container db cf";
            toopl.style.display = "none";
            setTimeout(toolshow2, 0);
        }
        function toolshow2() { tools2.style.display = "block"; if (config.eachtime > 0) setTimeout(toolclose,config.eachtime*1000); }
        toolclose = function () {
            footTool.className = "float_container";
            toopl.style.display = "none";
            document.getElementById('swtdingwei').style.display = 'block';
            tools2.style.display = "none";
            setTimeout(toolshow, config.relapsetime * 1000);
        }


    };
    lib.load(loadFunc);/*执行代码*/
})('{{lib}}', '{{config}}');